<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>微信JS-SDK</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0">
</head>
<body>
<p>微信微信JS-SDK</p>
<p>url : {{$url}}</p>
<p>appid : {{$appId}}</p>
<p>timestamp : {{$timestamp}}</p>
<p>nonceStr : {{$nonceStr}}</p>
<p>signature : {{$signature}}</p>
</body>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>
    wx.config({
        debug: true,
        appId: '{{$appId}}',
        timestamp: '{{$timestamp}}',
        nonceStr: '{{$nonceStr}}',
        signature: '{{$signature}}',
        jsApiList: [
            'checkJsApi',
            'onMenuShareTimeline',
            'onMenuShareAppMessage'
        ]
    });

    wx.ready(function () {
        var shareData = {
            title: '这里是分享标题',
            desc: '这里是发送给好友的时候的简介',
            link: 'http://baidu.com',
            imgUrl: 'http://baidu.com/logo.jpg'
        };
        wx.onMenuShareAppMessage(shareData);
        wx.onMenuShareTimeline(shareData);
    });

    wx.error(function (res) {
        alert(res.errMsg);
    });
</script>
</html>
